﻿<UserControl x:Class="ABCat.UI.WPF.UI.CatalogViewerUc"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:ad="clr-namespace:Xceed.Wpf.AvalonDock;assembly=Xceed.Wpf.AvalonDock"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:models="clr-namespace:ABCat.UI.WPF.Models"
             xmlns:primitives="clr-namespace:ABCat.UI.WPF.UI.Primitives"
             xmlns:ui2="clr-namespace:ABCat.UI.WPF.UI"
             xmlns:xcad="http://schemas.xceed.com/wpf/xaml/avalondock"
             d:DataContext="{d:DesignInstance Type=models:ABCatViewModel}"
             d:DesignHeight="500"
             d:DesignWidth="600"
             mc:Ignorable="d">
	<UserControl.Resources>
		<BooleanToVisibilityConverter x:Key="btvc" />
	</UserControl.Resources>

	<Grid>
		<Grid.RowDefinitions>
			<RowDefinition Height="Auto" />
			<RowDefinition Height="1*" />
			<RowDefinition Height="Auto" />
		</Grid.RowDefinitions>
		<Menu Foreground="{StaticResource ForegroundColorBrush}" Style="{DynamicResource MenuStyle1}">
			<MenuItem Template="{DynamicResource MenuItemTemplate}" ToolTip="Каталог">
				<MenuItem.Icon>
					<Path Data="M18.698001,56.938L18.698001,59.728001 31.349,59.728001 31.349,56.938z M1.8610001,56.938L1.8610001,59.727997 11.535001,59.727997 11.535001,56.938z M59.898386,55.058998L45.885002,57.419712 46.34852,60.171997 60.362001,57.811481z M52.786489,12.724999L38.773001,15.086076 39.236515,17.838997 53.250002,15.477921z M1.8610001,10.271L1.8610001,13.061001 11.535001,13.061001 11.535001,10.271z M54.079065,9.757L62.307001,61.243523 45.055634,64 36.829,12.513545z M0,5.21L13.394,5.21 13.394,64 0,64z M18.698001,4.9379997L18.698001,7.7279997 31.349,7.7279997 31.349,4.9379997z M17.023001,0L33.023001,0 33.023001,64 17.023001,64z"
					      Fill="{StaticResource ForegroundColorBrush}"
					      Stretch="Uniform" />
				</MenuItem.Icon>
				<MenuItem Command="{Binding SiteParserModel.DownloadRecordGroupsCommand}"
				          Header="Обновить список записей"
				          Template="{DynamicResource MenuItemTemplate}">
					<MenuItem.Icon>
						<Path Data="M44.817715,32.701C44.817715,36.424438 43.317719,39.769474 40.880226,42.212898 38.434834,44.649822 35.091141,46.147739 31.369753,46.150341 27.679762,46.150341 24.35157,44.671223 21.919287,42.2715L26.742264,37.44965 13.336,37.44965 13.336,50.854187 17.786488,46.404942C21.270859,49.861279 26.078165,52 31.369753,52 42.028622,51.998199 50.661396,43.359409 50.663998,32.701z M32.635052,12C21.97893,12.002014,13.341001,20.637493,13.341001,31.295L19.187323,31.295C19.189894,27.57238 20.68988,24.227364 23.127359,21.784601 25.567509,19.347088 28.913782,17.849091 32.635052,17.84647 36.379917,17.84647 39.757488,19.373089 42.197472,21.83989L37.58041,26.455275 50.660995,26.455275 50.660995,13.373056 46.330338,17.702539C42.838165,14.183121,37.989204,12,32.635052,12z M32,0C49.6744,0 64,14.3269 64,32 64,49.673199 49.6744,64 32,64 14.3281,64 0,49.673199 0,32 0,14.3269 14.3281,0 32,0z"
						      Fill="#FF000000"
						      Stretch="Uniform" />
					</MenuItem.Icon>
				</MenuItem>
				<MenuItem Command="{Binding SiteParserModel.DownloadRecordsCommand}"
				          Header="Обновить записи"
				          Template="{DynamicResource MenuItemTemplate}">
					<MenuItem.Icon>
						<Path Data="M2.7499252,30.299848L18.669936,37.698865 14.349932,40.728464C17.789935,43.70807 22.169938,45.567823 26.799941,45.567823 35.689946,45.567823 43.469952,39.758592 45.309953,31.289716L45.599953,30.639802 53.339959,30.639802 52.979958,31.949628C50.759957,44.417974 39.749951,52.776868 26.799941,52.776868 19.539937,52.776868 12.809932,49.897249 7.8799284,44.937906L4.2499259,47.387582z M26.539532,0C33.809293,-6.8510417E-08,40.529256,2.7602325,45.459096,7.7205935L49.089028,5.050457 50.589001,21.701824 34.669381,15.291273 38.989247,12.360982C35.549249,9.3807617 31.16945,7.7306042 26.539532,7.7306042 17.649688,7.7306042 9.8698071,13.921167 8.0298765,22.401832L7.7398427,23.832002 0,23.832002 0.3599781,21.681804C2.5799068,9.2108264,13.589706,-6.8510417E-08,26.539532,0z"
						      Fill="#FF000000"
						      Stretch="Uniform" />
					</MenuItem.Icon>
				</MenuItem>
			</MenuItem>
			<MenuItem Command="{Binding RefreshCommand}"
			          Template="{DynamicResource MenuItemTemplate}"
			          ToolTip="Обновить список">
				<MenuItem.Icon>
					<Path Data="M2.7499252,30.299848L18.669936,37.698865 14.349932,40.728464C17.789935,43.70807 22.169938,45.567823 26.799941,45.567823 35.689946,45.567823 43.469952,39.758592 45.309953,31.289716L45.599953,30.639802 53.339959,30.639802 52.979958,31.949628C50.759957,44.417974 39.749951,52.776868 26.799941,52.776868 19.539937,52.776868 12.809932,49.897249 7.8799284,44.937906L4.2499259,47.387582z M26.539532,0C33.809293,-6.8510417E-08,40.529256,2.7602325,45.459096,7.7205935L49.089028,5.050457 50.589001,21.701824 34.669381,15.291273 38.989247,12.360982C35.549249,9.3807617 31.16945,7.7306042 26.539532,7.7306042 17.649688,7.7306042 9.8698071,13.921167 8.0298765,22.401832L7.7398427,23.832002 0,23.832002 0.3599781,21.681804C2.5799068,9.2108264,13.589706,-6.8510417E-08,26.539532,0z"
					      Fill="#FF000000"
					      Stretch="Uniform" />
				</MenuItem.Icon>
			</MenuItem>
			<MenuItem Command="{Binding ConfigCommand}"
			          Template="{DynamicResource MenuItemTemplate}"
			          ToolTip="Настройки">
				<MenuItem.Icon>
					<Path Data="M31.679651,15.723C22.841078,15.723 15.677,22.887022 15.677,31.724249 15.677,40.562878 22.841078,47.727002 31.679651,47.727002 40.518124,47.727002 47.682003,40.562878 47.682003,31.724249 47.682003,22.887022 40.518124,15.723 31.679651,15.723z M25.174641,0L30.947304,8.1649995 30.977009,8.163671C31.891628,8.1361193,32.811726,8.1617675,33.732849,8.2423577L34.116646,8.2807278 40.096367,0.5289996 49.181995,4.5158782 47.510448,14.236901 47.626137,14.339919C48.479649,15.11912,49.268909,15.955267,49.990528,16.839653L50.234638,17.14785 60.403648,15.836 64.007996,25.079203 55.322643,31.217757 55.324234,31.258986C55.34618,32.174153,55.314838,33.094563,55.22847,34.015755L55.226952,34.030385 63.345997,40.294331 59.359104,49.380002 49.249798,47.645153 49.143776,47.764214C48.695721,48.255009,48.228832,48.72456,47.744774,49.172226L47.324875,49.549786 48.723995,60.394425 39.48156,64 33.403603,55.403061 33.023663,55.43042C32.149929,55.481137,31.270197,55.483376,30.38839,55.435608L29.679308,55.383191 23.130268,63.875 14.041999,59.886834 15.844025,49.393521 15.71986,49.282948C15.207753,48.815411,14.718776,48.32737,14.253661,47.820706L13.803129,47.315312 3.612031,48.630002 0.0080004195,39.385499 8.0905037,33.673707 8.0481892,33.048829C7.9875851,31.908507,8.0095654,30.758269,8.1175261,29.606822L8.1191311,29.59272 0,23.328246 3.9867127,14.242 14.093521,15.978928 14.104487,15.966273C15.033746,14.935561,16.045525,13.997155,17.124784,13.156928L17.159048,13.131042 15.929999,3.6040602z"
					      Fill="#FF000000"
					      Stretch="Uniform" />
				</MenuItem.Icon>
			</MenuItem>
		</Menu>
		<ad:DockingManager x:Name="DockingManager" Grid.Row="1">
			<ad:DockingManager.Theme>
				<xcad:MetroTheme />
			</ad:DockingManager.Theme>
			<xcad:LayoutRoot>
				<xcad:LayoutPanel Orientation="Horizontal">
					<xcad:LayoutAnchorablePaneGroup DockWidth="220" Orientation="Vertical">
						<xcad:LayoutAnchorablePane>
							<xcad:LayoutAnchorable Title="Группы"
							                       CanAutoHide="True"
							                       CanClose="False"
							                       CanHide="False"
							                       ContentId="6">
								<ui2:GroupsTreeUc DataContext="{Binding GrouppingLogicModel}" />

							</xcad:LayoutAnchorable>
						</xcad:LayoutAnchorablePane>
						<xcad:LayoutAnchorablePane>
							<xcad:LayoutAnchorable Title="Фильтр"
							                       CanClose="False"
							                       CanHide="False"
							                       ContentId="5">
								<ui2:RecordsFilterUc x:Name="FilterUc" />
							</xcad:LayoutAnchorable>
						</xcad:LayoutAnchorablePane>
					</xcad:LayoutAnchorablePaneGroup>
					<xcad:LayoutDocumentPaneGroup>
						<xcad:LayoutDocumentPane>
							<xcad:LayoutDocument Title="Каталог"
							                     CanClose="False"
							                     CanFloat="True"
							                     ContentId="2"
							                     IsMaximized="True">
								<Grid>
									<Grid.RowDefinitions>
										<RowDefinition Height="Auto" />
										<RowDefinition Height="1*" />
									</Grid.RowDefinitions>
									<ContentPresenter Grid.Row="1" Content="{Binding RecordsListUc.Control}">
										<ContentPresenter.ContextMenu>
											<ContextMenu>
												<ContextMenu.ItemContainerStyle>
													<Style TargetType="{x:Type MenuItem}">
														<!--  <Setter Property="Command" Value="{Binding Command}" />  -->
														<Setter Property="CommandParameter" Value="{Binding SelectedItems}" />
													</Style>
												</ContextMenu.ItemContainerStyle>
												<MenuItem Command="{Binding RecordTargetDownloaderModel.DownloadRecordTargetCommand}"
												          Header="Загрузить"
												          Icon="{StaticResource DownloadRecordTargetIcon}"
												          Template="{StaticResource MenuItemTemplate}" />
												<MenuItem Command="{Binding ShowCachedInBrowserCommand}"
												          Header="Показать страницу"
												          Icon="{StaticResource DocumentFromCacheIcon}"
												          Template="{StaticResource MenuItemTemplate}" />
												<MenuItem Command="{Binding HideSelectedRecordsCommand}"
												          Header="Скрыть выделенное"
												          Icon="{StaticResource HideRecordsIcon}"
												          Template="{StaticResource MenuItemTemplate}" />
												<MenuItem Command="{Binding SetReplacementCommand}"
												          Header="Настроить автозамену"
												          Icon="{StaticResource ReplaceIcon}"
												          Template="{StaticResource MenuItemTemplate}" />
												<MenuItem Command="{Binding SiteParserModel.ReparseCommand}"
												          Header="Повторить обработку строк"
												          Icon="{StaticResource RepeatIcon}"
												          Template="{StaticResource MenuItemTemplate}" />
											</ContextMenu>
										</ContentPresenter.ContextMenu>
									</ContentPresenter>
								</Grid>
							</xcad:LayoutDocument>
						</xcad:LayoutDocumentPane>
					</xcad:LayoutDocumentPaneGroup>
					<xcad:LayoutAnchorablePaneGroup DockWidth="220" Orientation="Vertical">
						<xcad:LayoutAnchorablePane>
							<xcad:LayoutAnchorable Title="Редактор автозамены"
							                       CanAutoHide="True"
							                       CanClose="False"
							                       CanHide="False"
							                       ContentId="4">
								<ContentPresenter Content="{Binding NormalizationSettingsEditorModel.NormalizationSettingsEditorPlugin.Control}" />
							</xcad:LayoutAnchorable>
						</xcad:LayoutAnchorablePane>
					</xcad:LayoutAnchorablePaneGroup>
				</xcad:LayoutPanel>
			</xcad:LayoutRoot>
		</ad:DockingManager>

		<ui2:StatusBarUc x:Name="StatusBarStateUc" Grid.Row="2" />

	</Grid>
</UserControl>
